#ifndef BEGINCONNDESTHANDLERBASE_H
#define BEGINCONNDESTHANDLERBASE_H

#include <WinSock2.h>
#include "ITransHandler.h"
#include "Log.h"

class BeginConnDestHandlerBase abstract:public ITransHandler
{
public:
	BeginConnDestHandlerBase(){}

	~BeginConnDestHandlerBase(){}

	virtual ExecuteResultCode Execute(ClientContext&,OVERLAPPED*);

protected:
	virtual void CreateSocketPostProcess(ClientContext&,OVERLAPPED*,SOCKET sock){};

	virtual const std::string& DestinationServerName(ClientContext&);

	virtual const unsigned short DestinationServerPort(ClientContext&);

	virtual ITransHandler* GetNextHandler() abstract;

	virtual ExecuteResultCode OnExecuteError(ClientContext&,OVERLAPPED*,ExecuteResultCode) abstract;

	virtual ExecuteResultCode OnConnected(ClientContext&,OVERLAPPED*);

private:
	static log4cplus::Logger log;
};

#endif